import React from 'react'
import { useState } from 'react'

export default function RegisterPage() {
  const [state, setState] = useState({
    userInfo: {
      userName: '蒋皓天',
      job: '前端工程师'
    }
  })
  function onChangeUserInfo() {
    setState({
      userInfo: {
        ...JSON.parse(JSON.stringify(state.userInfo)),
        userName: '周钰'
      }
    })
    console.log('state:', state)
  }
  console.log('state:', state)
  return (
      <div>
        <h1>注册页面</h1>
        <div>
          <button onClick={() => onChangeUserInfo()}>修改内容</button>
        </div>
      </div>
  )
}
